#Copyright (c) 2025, Alibaba Cloud and its affiliates;
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at

#   http://www.apache.org/licenses/LICENSE-2.0

#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.



import requests
import uuid

url = "http://SERVER_HOST_IP:12021/cluster/envInit"

def get_request_id():
    return str(uuid.uuid1())

request_id = get_request_id()
print('Init cluster env request id: %s '  % request_id)

data = {
    "RequestId": request_id,
    "KubeConfPath": "/root/.kube/config",
    "SDKPath": "/root/sdk",
    "OperatorImage": "registry-vpc.cn-hangzhou.cr.aliyuncs.com/fce/operator:v1.1.1",
}

response = requests.post(url, data=data, verify=False)

if response.status_code == 200:
    received_data = response.json()
    print("Received data:", received_data)
else:
    print("Request failed with status code:", response.status_code)